<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>新增页面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="_csrf" content="${_csrf.token}"/>
    <meta name="_csrf_header" content="${_csrf.headerName}"/>
    <link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/favicon.ico">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/back/lib/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/back/css/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/back/css/xadmin.css">
    <style>
        .x-red {
            position: absolute;
            left: 6px;
            top: 2px;
            margin-right: 2px;
            color: red;
            float: left;
            z-index: 1;
        }

        .xm-select-parent .xm-form-select dd {
            margin-left: 15px;
        }
    </style>
</head>

<body>
<div class="x-body">
    <form class="layui-form layui-form-pane" lay-filter="form-sms" onsubmit="return false;">
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>主题</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="title" lay-verify="required"
                       placeholder="主题" autocomplete="off">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="remark" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <button class="layui-btn" style="float: right" id="my-submit" lay-filter="submit" lay-submit>保存信息</button>
        </div>
    </form>
</div>

<script type="text/javascript" src="${pageContext.request.contextPath }/back/lib/layui/layui.js"
        charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/back/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/httptTools.js"></script>
<jsp:include page="/WEB-INF/page/layui_version.jsp"></jsp:include>

<script>
    layui.use(['form', 'layer', 'lutil'], function () {
        var form = layui.form,
            lutil = layui.lutil,
            layer = layui.layer;
        form.on('submit(submit)', function (formData) {
            var loding = layer.load(2, {shade: [0.3, '#eee']});
            ajaxRequestByCsrf('${pageContext.request.contextPath }/back/page_config/page_save.do', formData.field, function (res) {
                lutil.success_msg(res.message);
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index);
            }, null, function (res) {
                layer.close(loding);
            });
            return false;
        });
    })
</script>
</body>
</html>
